import { BroadCastCall } from "../../broadCast/BroadCastCall";
import { MessageBlock } from "../../../../../Framework/MQ/MessageBlock";
import { SPetExploreInFight } from "../../../../../Message/Public/SPetExploreInFight";
import { EntityUtil } from "../../../scene/layer/utils/EntityUtil";
import { NetDispatcher } from "../../../../mvc/core/NetDispatcher";
import { ServerCommand } from "../../../mvc/ServerCommand";
//class PetExploreFightIndexCommand
    
    export  class PetExploreFightIndexCommand extends BroadCastCall
    {
        constructor(arg1: Object)
        {
            super(arg1);
            return;
        }

        public /* override */ call(arg1: MessageBlock): void
        {
            super.call(arg1);
            var loc1=arg1.messageBase as SPetExploreInFight;
            var loc2=_cache.petExplore.battlePetEntityInfo;
            if (loc2 && loc2.entityId && EntityUtil.equal(loc1.entityId, loc2.entityId)) 
            {
                _cache.petExplore.battlePetFightFightAttribute = loc1.fight;
            }
            NetDispatcher.dispatchCmd(ServerCommand.PetExploreFightIndexCommand, loc1);
            return;
        }
    }
